<template>
  <view class="vm-page bg-efefef vh">
    <view class="company-info">
      <image
        :src="imgAssets.main.logo_luatos"
        class="company-logo"
        mode="widthFix"
      />
      <!-- <view class="company-name">合宙LuatOS出品</view> -->
    </view>

    <view class="company-link">
      <nut-cell-group>
        <nut-cell
          v-for="m in meuns"
          :key="m.title"
          :title="m.title"
          is-link
          :url="m.link"
          @tap="toMenuItem(m)"
        ></nut-cell>
      </nut-cell-group>
    </view>
  </view>
</template>

<script lang="ts">
import imgAssets from "@/images/index";
import Taro from "@tarojs/taro";

export default {
  name: "Index",
  data() {
    return {
      imgAssets,
      meuns: [
        {
          title: "合宙商城",
          appId: "wx4478bb3c71cdd01f",
          type: "miniapp",
        },
        {
          title: "LuatOS技术支持",
          path: "/pages/luatosSupport/index",
          type: "page",
        },
      ],
    };
  },
  components: {},
  methods: {
    toMenuItem(menu) {
      if (menu.type == "web") {
        Taro.navigateTo({
          url: `/pages/webview/index?t=${menu.title}&url=${menu.link}`,
        });
      }
      if (menu.type == "miniapp") {
        Taro.navigateToMiniProgram({
          appId: menu.appId,
        });
      }
      if (menu.type == "page") {
        Taro.navigateTo({
          url: menu.path,
        });
      }
    },
  },
};
</script>

<style lang="scss">
.company-info {
  text-align: center;
  padding: 50px 0;

  .company-logo {
    display: inline-block;
    width: 200px;
  }
  .company-name {
    margin-top: 20px;
    color: #333;
    font-size: 20px;
  }
}
</style>
